﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FanaticToy.Core.IdentifierStrategy
{
    ///<summary>定位标识符。</summary>
    public class LocationIdentifier
    {
        ///<summary>层级Id。</summary>
        public string NodeId { get; set; }

        public string FileId { get; set; }
        
        public string MemberId { get; set; }

        public LocationIdentifier()
        {
            
        }

        public LocationIdentifier(string nodeId, string fileId, string member)
        {
            NodeId = nodeId;
            FileId = fileId;
            MemberId = member;
        }
    }


    public class LocationIdentifierHelper
    {
        public static bool IsEqual(LocationIdentifier id1, LocationIdentifier id2)
        {
            if (id1 == id2) return true;
            if(id1.FileId == id2.FileId &&  id1.MemberId == id2.MemberId) return true;
            return false;
        }

        public static bool IsEqualInFile(LocationIdentifier id1, LocationIdentifier id2)
        {
            if (id1 == id2) return true;
            if (id1.FileId == id2.FileId) return true;
            return false;
        }
    }
}
